﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using TomShane.Neoforce.Controls;

namespace Madrigal
{
    class WndConnectBox : GameScreen
    {
        Manager manager;
        Window connectBox;
        TextBox tbConnectText;
        Button btnCancel;

        public WndConnectBox(Manager manager)
        {
            this.manager = manager;
            IsPopup = true;
            
            connectBox = new Window(manager);
            connectBox.Init();
            connectBox.Resizable = false;
            connectBox.Width = 128;
            connectBox.Height = 128;
            connectBox.Closed +=new WindowClosedEventHandler(connectBox_Closed);

            tbConnectText = new TextBox(manager);
            tbConnectText.Init();
            tbConnectText.Mode = TextBoxMode.Multiline;
            tbConnectText.Text = "Connecting.... \n Please Wait....";
            tbConnectText.SetPosition(connectBox.ClientArea.Left + 10, connectBox.ClientArea.Top + 5);
            tbConnectText.Parent = connectBox;

            btnCancel = new Button(manager);
            btnCancel.Init();
            btnCancel.Text = "Cancel";
            btnCancel.SetPosition(tbConnectText.Width / 2, tbConnectText.Top + 32);
            btnCancel.Parent = connectBox;
            manager.Add(connectBox);
        }

        void connectBox_Closed(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            connectBox.Close();
            ScreenManager.RemoveScreen(this);
        }


    }
}
